{% extends "../master.html" %}

{% block header %}
    {% include "../header.html" %}
{% endblock %}

{% block menu %}
    {% include "menu_album.html" %}
{% endblock %}

{% block page %}
    <h1>Album:</h1>
    <b>{{ album }}</b>
    <form class="form" action="/{{ page }}/edit" method="post">
    <div class="button">
        <input name="cancel" value="[Cancel]" type="submit" />
        <input name="nb_of_pictures" value="{{ nb_of_pictures }}" type="hidden" />
        <input name="picture_key" value="{{ picture_key }}" type="hidden" />
        <input name="size_key" value="{{ size.key }}" type="hidden" />
        <input name="language_key" value="{{ language.key }}" type="hidden" />
    </div>
    </form>
    <br />
    <div class="picture-links">
        <table>
            <tr>
            {% for link in links %}
                <td>
                {% if link.input %}
                <form class="form" action="/{{ page }}/edit_image" method="post">
                <div class="button">
                    <input class="button" name="show" value="{{ link.id }}" type="submit" />
                    <input name="album" value="{{ album }}" type="hidden" />
                    <input name="offset" value="{{ link.offset }}" type="hidden" />
                    <input name="nb_of_pictures" value="{{ nb_of_pictures }}" type="hidden" />
                    <input name="picture_key" value="{{ picture_key }}" type="hidden" />
                    <input name="size_key" value="{{ size.key }}" type="hidden" />
                    <input name="language_key" value="{{ language.key }}" type="hidden" />
                </div>
                </form>
                {% else %}
                    {{ link.id }}
                {% endif %}
                </td>
            {% endfor %}
            </tr>
        </table>
    </div>
    <div class="image">
        <table>
            {% for raw in images %}
            <tr>
                {% for image in raw %}
                <td>
                    <img src="/img?url={{ image }}&amp;size=600&amp;nb_of_pictures=4" alt="{{ image }}" />
                    <form class="form" action="/{{ page }}/save_image" method="post">
                    <div class="button">
                        <input name="select" value="[Select]" type="submit" />
                        <input name="url" value="{{ image }}" type="hidden" />
                        <input name="nb_of_pictures" value="{{ nb_of_pictures }}" type="hidden" />
                        <input name="picture_key" value="{{ picture_key }}" type="hidden" />
                        <input name="size_key" value="{{ size.key }}" type="hidden" />
                        <input name="language_key" value="{{ language.key }}" type="hidden" />
                    </div>
                    </form>
                </td>
                {% endfor %}
            </tr>
            {% endfor %}
        </table>
    </div>
    <div class="picture-links">
        <table>
            <tr>
            {% for link in links %}
                <td>
                    {% if link.input %}
                    <form class="form" action="/{{ page }}/edit_image" method="post">
                    <div class="button">
                        <input class="button" name="show" value="{{ link.id }}" type="submit" />
                        <input name="picture_key" value="{{ picture_key }}" type="hidden" />
                        <input name="offset" value="{{ link.offset }}" type="hidden" />
                        <input name="nb_of_pictures" value="{{ nb_of_pictures }}" type="hidden" />
                        <input name="size_key" value="{{ size.key }}" type="hidden" />
                        <input name="language_key" value="{{ language.key }}" type="hidden" />
                    </div>
                    </form>
                    {% else %}
                        {{ link.id }}
                    {% endif %}
                </td>
            {% endfor %}
            </tr>
        </table>
    </div>
    <br />
    <form class="form" action="/{{ page }}/edit" method="post">
    <div class="button">
        <input name="cancel" value="[Cancel]" type="submit" />
        <input name="picture_key" value="{{ picture.key }}" type="hidden" />
        <input name="nb_of_pictures" value="{{ nb_of_pictures }}" type="hidden" />
        <input name="size_key" value="{{ size.key }}" type="hidden" />
        <input name="language_key" value="{{ language.key }}" type="hidden" />
    </div>
    </form>
{% endblock %}

{% block footer %}
    {% include "../footer.html" %}
{% endblock %}
